<?php
$get_category = $inancm->select_db("select * from inancm_category order by cat_id");
$get_blog = $inancm->select_db("select * from inancm_blog order by blog_id desc limit 0,5");
//$inancm->pre($get_blog);
?>

<div class="rightsection rightsectionalt">

    <!-- Start Blog Widget -->
    <div class="blogwidgetstart">
        <!-- Start Advertising Widget -->
        <div class="widgettitle"><h4>Advertising</h4></div>        
        <div class="widgetbody">        
            <div class="blogadvertising">            
            <a href="#"><img src="images/advertising/engwing41.jpg"  alt="English Center Wing 41"></a>
            <a href="#"><img src="images/advertising/inancm.jpg" alt="iNan...CM"></a>
            <a href="#"><img src="images/advertising/siamforu.jpg" alt="Siamforu"></a>
            <a href="#"><img src="images/advertising/siambooking.jpg" alt="Booking"></a>            
            </div>        
      </div>
      <!-- End Advertising Widget -->
      <span class="box-arrow"></span>    
    </div>
    <!-- End Blog Widget -->
    
    <!-- Start Blog Widget -->
    <div class="blogwidget">
        <!-- Start Categories Widget -->
        <div class="widgettitle"><h4>Blog Categories</h4></div>
        
        <div class="widgetbody">
        
            <div class="blogcategories">
            
                <ul>
                    <li><a href="?page=<?=$page?>" title="All Blogs">All Blogs</a></li>
                    <?php foreach($get_category as $val) { ?>
                    	<li><a href="?page=<?=$page?>&cid=<?=$val['cat_id'];?>" title="<?=$val['cat_name'];?>"><?=$val['cat_name'];?></a></li>
                    <?php } ?>                                        
                </ul>
            
            </div>
        
      </div>
      <!-- End Categories Widget -->
      <span class="box-arrow"></span>
    
    </div>
    <!-- End Blog Widget -->
    
    <!-- Start Blog Widget -->
    <div class="blogwidget">
        <!-- Start Categories Widget -->
        <div class="widgettitle"><h4>Last Posts</h4></div>
        
        <div class="widgetbody">
        
            <div class="blogcategories">
            
                <ul>
                	<?php foreach($get_blog as $val){ ?>
                    	<li><a href="?page=<?=$page?>&bid=<?=$val['blog_id'];?>" title="All Blogs"><?=$val['blog_title'];?></a></li>
                    <?php } ?>                    
                </ul>
            
            </div>
        
      </div>
      <!-- End Categories Widget -->
      <span class="box-arrow"></span>
    
    </div>
    <!-- End Blog Widget -->

</div>